3.236 \(\int \frac{\cot ^6(e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=218 \[ \frac{b^{7/2} (9 a-7 b) \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{2 a^{9/2} f (a-b)^2}+\frac{\left (2 a^2+2 a b-7 b^2\right ) \cot ^3(e+f x)}{6 a^3 f (a-b)}-\frac{\left (2 a^2 b+2 a^3+2 a b^2-7 b^3\right ) \cot (e+f x)}{2 a^4 f (a-b)}-\frac{(2 a-7 b) \cot ^5(e+f x)}{10 a^2 f (a-b)}-\frac{b \cot ^5(e+f x)}{2 a f (a-b) \left (a+b \tan ^2(e+f x)\right )}-\frac{x}{(a-b)^2} \]

[Out]

-(x/(a - b)^2) + ((9*a - 7*b)*b^(7/2)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/(2*a^(9/2)*(a - b)^2*f) - ((2*a^
3 + 2*a^2*b + 2*a*b^2 - 7*b^3)*Cot[e + f*x])/(2*a^4*(a - b)*f) + ((2*a^2 + 2*a*b - 7*b^2)*Cot[e + f*x]^3)/(6*a
^3*(a - b)*f) - ((2*a - 7*b)*Cot[e + f*x]^5)/(10*a^2*(a - b)*f) - (b*Cot[e + f*x]^5)/(2*a*(a - b)*f*(a + b*Tan
[e + f*x]^2))

________________________________________________________________________________________

Rubi [A]  time = 0.341666, antiderivative size = 218, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {3670, 472, 583, 522, 203, 205} \[ \frac{b^{7/2} (9 a-7 b) \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{2 a^{9/2} f (a-b)^2}+\frac{\left (2 a^2+2 a b-7 b^2\right ) \cot ^3(e+f x)}{6 a^3 f (a-b)}-\frac{\left (2 a^2 b+2 a^3+2 a b^2-7 b^3\right ) \cot (e+f x)}{2 a^4 f (a-b)}-\frac{(2 a-7 b) \cot ^5(e+f x)}{10 a^2 f (a-b)}-\frac{b \cot ^5(e+f x)}{2 a f (a-b) \left (a+b \tan ^2(e+f x)\right )}-\frac{x}{(a-b)^2} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^6/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-(x/(a - b)^2) + ((9*a - 7*b)*b^(7/2)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/(2*a^(9/2)*(a - b)^2*f) - ((2*a^
3 + 2*a^2*b + 2*a*b^2 - 7*b^3)*Cot[e + f*x])/(2*a^4*(a - b)*f) + ((2*a^2 + 2*a*b - 7*b^2)*Cot[e + f*x]^3)/(6*a
^3*(a - b)*f) - ((2*a - 7*b)*Cot[e + f*x]^5)/(10*a^2*(a - b)*f) - (b*Cot[e + f*x]^5)/(2*a*(a - b)*f*(a + b*Tan
[e + f*x]^2))

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 472

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> -Simp[(b*(e*x
)^(m + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(a*e*n*(b*c - a*d)*(p + 1)), x] + Dist[1/(a*n*(b*c - a*d)*(
p + 1)), Int[(e*x)^m*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*b*(m + 1) + n*(b*c - a*d)*(p + 1) + d*b*(m + n*(
p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, m, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p
, -1] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 583

Int[((g_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)),
x_Symbol] :> Simp[(e*(g*x)^(m + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(a*c*g*(m + 1)), x] + Dist[1/(a*c*
g^n*(m + 1)), Int[(g*x)^(m + n)*(a + b*x^n)^p*(c + d*x^n)^q*Simp[a*f*c*(m + 1) - e*(b*c + a*d)*(m + n + 1) - e
*n*(b*c*p + a*d*q) - b*e*d*(m + n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p, q}, x] &&
 IGtQ[n, 0] && LtQ[m, -1]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\cot ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{x^6 \left (1+x^2\right ) \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{b \cot ^5(e+f x)}{2 a (a-b) f \left (a+b \tan ^2(e+f x)\right )}+\frac{\operatorname{Subst}\left (\int \frac{2 a-7 b-7 b x^2}{x^6 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{2 a (a-b) f}\\ &=-\frac{(2 a-7 b) \cot ^5(e+f x)}{10 a^2 (a-b) f}-\frac{b \cot ^5(e+f x)}{2 a (a-b) f \left (a+b \tan ^2(e+f x)\right )}-\frac{\operatorname{Subst}\left (\int \frac{5 \left (2 a^2+2 a b-7 b^2\right )+5 (2 a-7 b) b x^2}{x^4 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{10 a^2 (a-b) f}\\ &=\frac{\left (2 a^2+2 a b-7 b^2\right ) \cot ^3(e+f x)}{6 a^3 (a-b) f}-\frac{(2 a-7 b) \cot ^5(e+f x)}{10 a^2 (a-b) f}-\frac{b \cot ^5(e+f x)}{2 a (a-b) f \left (a+b \tan ^2(e+f x)\right )}+\frac{\operatorname{Subst}\left (\int \frac{15 \left (2 a^3+2 a^2 b+2 a b^2-7 b^3\right )+15 b \left (2 a^2+2 a b-7 b^2\right ) x^2}{x^2 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{30 a^3 (a-b) f}\\ &=-\frac{\left (2 a^3+2 a^2 b+2 a b^2-7 b^3\right ) \cot (e+f x)}{2 a^4 (a-b) f}+\frac{\left (2 a^2+2 a b-7 b^2\right ) \cot ^3(e+f x)}{6 a^3 (a-b) f}-\frac{(2 a-7 b) \cot ^5(e+f x)}{10 a^2 (a-b) f}-\frac{b \cot ^5(e+f x)}{2 a (a-b) f \left (a+b \tan ^2(e+f x)\right )}-\frac{\operatorname{Subst}\left (\int \frac{15 \left (2 a^4+2 a^3 b+2 a^2 b^2+2 a b^3-7 b^4\right )+15 b \left (2 a^3+2 a^2 b+2 a b^2-7 b^3\right ) x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{30 a^4 (a-b) f}\\ &=-\frac{\left (2 a^3+2 a^2 b+2 a b^2-7 b^3\right ) \cot (e+f x)}{2 a^4 (a-b) f}+\frac{\left (2 a^2+2 a b-7 b^2\right ) \cot ^3(e+f x)}{6 a^3 (a-b) f}-\frac{(2 a-7 b) \cot ^5(e+f x)}{10 a^2 (a-b) f}-\frac{b \cot ^5(e+f x)}{2 a (a-b) f \left (a+b \tan ^2(e+f x)\right )}-\frac{\operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{(a-b)^2 f}+\frac{\left ((9 a-7 b) b^4\right ) \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{2 a^4 (a-b)^2 f}\\ &=-\frac{x}{(a-b)^2}+\frac{(9 a-7 b) b^{7/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{2 a^{9/2} (a-b)^2 f}-\frac{\left (2 a^3+2 a^2 b+2 a b^2-7 b^3\right ) \cot (e+f x)}{2 a^4 (a-b) f}+\frac{\left (2 a^2+2 a b-7 b^2\right ) \cot ^3(e+f x)}{6 a^3 (a-b) f}-\frac{(2 a-7 b) \cot ^5(e+f x)}{10 a^2 (a-b) f}-\frac{b \cot ^5(e+f x)}{2 a (a-b) f \left (a+b \tan ^2(e+f x)\right )}\\ \end{align*}

Mathematica [A]  time = 5.02335, size = 165, normalized size = 0.76 \[ \frac{\frac{15 b^{7/2} (9 a-7 b) \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{a^{9/2} (a-b)^2}+\frac{15 \left (\frac{b^4 (a-b) \sin (2 (e+f x))}{a^4 ((a-b) \cos (2 (e+f x))+a+b)}-2 (e+f x)\right )}{(a-b)^2}-\frac{2 \cot (e+f x) \left (3 a^2 \csc ^4(e+f x)+23 a^2-a (11 a+10 b) \csc ^2(e+f x)+40 a b+45 b^2\right )}{a^4}}{30 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^6/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

((15*(9*a - 7*b)*b^(7/2)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/(a^(9/2)*(a - b)^2) - (2*Cot[e + f*x]*(23*a^2
 + 40*a*b + 45*b^2 - a*(11*a + 10*b)*Csc[e + f*x]^2 + 3*a^2*Csc[e + f*x]^4))/a^4 + (15*(-2*(e + f*x) + ((a - b
)*b^4*Sin[2*(e + f*x)])/(a^4*(a + b + (a - b)*Cos[2*(e + f*x)]))))/(a - b)^2)/(30*f)

________________________________________________________________________________________

Maple [A]  time = 0.102, size = 272, normalized size = 1.3 \begin{align*} -{\frac{1}{5\,f{a}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{5}}}+{\frac{1}{3\,f{a}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{3}}}+{\frac{2\,b}{3\,f{a}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{3}}}-{\frac{1}{f{a}^{2}\tan \left ( fx+e \right ) }}-2\,{\frac{b}{f{a}^{3}\tan \left ( fx+e \right ) }}-3\,{\frac{{b}^{2}}{f{a}^{4}\tan \left ( fx+e \right ) }}+{\frac{{b}^{4}\tan \left ( fx+e \right ) }{2\,f{a}^{3} \left ( a-b \right ) ^{2} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{{b}^{5}\tan \left ( fx+e \right ) }{2\,f{a}^{4} \left ( a-b \right ) ^{2} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{9\,{b}^{4}}{2\,f{a}^{3} \left ( a-b \right ) ^{2}}\arctan \left ({b\tan \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{7\,{b}^{5}}{2\,f{a}^{4} \left ( a-b \right ) ^{2}}\arctan \left ({b\tan \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) }{f \left ( a-b \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x)

[Out]

-1/5/f/a^2/tan(f*x+e)^5+1/3/f/a^2/tan(f*x+e)^3+2/3/f/a^3/tan(f*x+e)^3*b-1/f/a^2/tan(f*x+e)-2/f/a^3/tan(f*x+e)*
b-3/f/a^4/tan(f*x+e)*b^2+1/2/f*b^4/a^3/(a-b)^2*tan(f*x+e)/(a+b*tan(f*x+e)^2)-1/2/f*b^5/a^4/(a-b)^2*tan(f*x+e)/
(a+b*tan(f*x+e)^2)+9/2/f*b^4/a^3/(a-b)^2/(a*b)^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2))-7/2/f*b^5/a^4/(a-b)^2/(a
*b)^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2))-1/f/(a-b)^2*arctan(tan(f*x+e))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.92831, size = 1520, normalized size = 6.97 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

[-1/120*(120*a^4*b*f*x*tan(f*x + e)^7 + 120*a^5*f*x*tan(f*x + e)^5 + 60*(2*a^4*b - 9*a*b^4 + 7*b^5)*tan(f*x +
e)^6 + 24*a^5 - 48*a^4*b + 24*a^3*b^2 + 40*(3*a^5 - a^4*b - 9*a^2*b^3 + 7*a*b^4)*tan(f*x + e)^4 - 8*(5*a^5 - 3
*a^4*b - 9*a^3*b^2 + 7*a^2*b^3)*tan(f*x + e)^2 + 15*((9*a*b^4 - 7*b^5)*tan(f*x + e)^7 + (9*a^2*b^3 - 7*a*b^4)*
tan(f*x + e)^5)*sqrt(-b/a)*log((b^2*tan(f*x + e)^4 - 6*a*b*tan(f*x + e)^2 + a^2 - 4*(a*b*tan(f*x + e)^3 - a^2*
tan(f*x + e))*sqrt(-b/a))/(b^2*tan(f*x + e)^4 + 2*a*b*tan(f*x + e)^2 + a^2)))/((a^6*b - 2*a^5*b^2 + a^4*b^3)*f
*tan(f*x + e)^7 + (a^7 - 2*a^6*b + a^5*b^2)*f*tan(f*x + e)^5), -1/60*(60*a^4*b*f*x*tan(f*x + e)^7 + 60*a^5*f*x
*tan(f*x + e)^5 + 30*(2*a^4*b - 9*a*b^4 + 7*b^5)*tan(f*x + e)^6 + 12*a^5 - 24*a^4*b + 12*a^3*b^2 + 20*(3*a^5 -
 a^4*b - 9*a^2*b^3 + 7*a*b^4)*tan(f*x + e)^4 - 4*(5*a^5 - 3*a^4*b - 9*a^3*b^2 + 7*a^2*b^3)*tan(f*x + e)^2 - 15
*((9*a*b^4 - 7*b^5)*tan(f*x + e)^7 + (9*a^2*b^3 - 7*a*b^4)*tan(f*x + e)^5)*sqrt(b/a)*arctan(1/2*(b*tan(f*x + e
)^2 - a)*sqrt(b/a)/(b*tan(f*x + e))))/((a^6*b - 2*a^5*b^2 + a^4*b^3)*f*tan(f*x + e)^7 + (a^7 - 2*a^6*b + a^5*b
^2)*f*tan(f*x + e)^5)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**6/(a+b*tan(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.44007, size = 304, normalized size = 1.39 \begin{align*} \frac{\frac{15 \, b^{4} \tan \left (f x + e\right )}{{\left (a^{5} - a^{4} b\right )}{\left (b \tan \left (f x + e\right )^{2} + a\right )}} + \frac{15 \,{\left (9 \, a b^{4} - 7 \, b^{5}\right )}{\left (\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (b\right ) + \arctan \left (\frac{b \tan \left (f x + e\right )}{\sqrt{a b}}\right )\right )}}{{\left (a^{6} - 2 \, a^{5} b + a^{4} b^{2}\right )} \sqrt{a b}} - \frac{30 \,{\left (f x + e\right )}}{a^{2} - 2 \, a b + b^{2}} - \frac{2 \,{\left (15 \, a^{2} \tan \left (f x + e\right )^{4} + 30 \, a b \tan \left (f x + e\right )^{4} + 45 \, b^{2} \tan \left (f x + e\right )^{4} - 5 \, a^{2} \tan \left (f x + e\right )^{2} - 10 \, a b \tan \left (f x + e\right )^{2} + 3 \, a^{2}\right )}}{a^{4} \tan \left (f x + e\right )^{5}}}{30 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/30*(15*b^4*tan(f*x + e)/((a^5 - a^4*b)*(b*tan(f*x + e)^2 + a)) + 15*(9*a*b^4 - 7*b^5)*(pi*floor((f*x + e)/pi
 + 1/2)*sgn(b) + arctan(b*tan(f*x + e)/sqrt(a*b)))/((a^6 - 2*a^5*b + a^4*b^2)*sqrt(a*b)) - 30*(f*x + e)/(a^2 -
 2*a*b + b^2) - 2*(15*a^2*tan(f*x + e)^4 + 30*a*b*tan(f*x + e)^4 + 45*b^2*tan(f*x + e)^4 - 5*a^2*tan(f*x + e)^
2 - 10*a*b*tan(f*x + e)^2 + 3*a^2)/(a^4*tan(f*x + e)^5))/f